package scheduler

import "spider/concurrent/parser"

type QueueScheduler struct {
    RequestChan chan parser.Request
    workerChan  chan chan parser.Request
}

func (QueueScheduler *QueueScheduler) SetMasterWorkerChan(masterWorkerChan chan parser.Request) {
}

// worker准备完毕，分发RequestChan给worker
func (QueueScheduler *QueueScheduler) WorkerReady(RequestChan chan parser.Request) {
    workerChan <- RequestChan
}

// 提交request给调度器
func (QueueScheduler *QueueScheduler) Submit(request parser.Request) {
    // 添加到request队列
    QueueScheduler.RequestChan <- request
}
